<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%--
  Created by IntelliJ IDEA.
  User: LV
  Date: 2016/7/4
  Time: 9:07
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>退货详情</title>
        <script>
            $(function ($) {
            $("#select_pro").children("option").remove();
            $("#select_cty").children("option").remove();
            $("#select_dtr").children("option").remove();
            $("#select_pro").append("<option value='0'>"+"--请选择省、直辖市--"+"</option>");
            $("#select_cty").append("<option value='0'>"+"--请选择市、省直辖市--"+"</option>");
            $("#select_dtr").append("<option value='0'>"+"--请选择县、区--"+"</option>");
            $.getJSON("${ctx}/areas/getAreasList/null", function(json){
                //alert("JSON Data: " +json);
                //alert(json.length);
                for(var i in json){
                    //alert(json[i].areaName);
                    $("#select_pro").append("<option value='"+json[i].areaCode+"'>"+json[i].areaName+"</option>");}
            });

            //省市发生改变时
            $("#select_pro").change(function () {
                //给隐藏省名赋值
                $("#provinceName").val($("#select_pro option:selected").text());
                $("#select_cty").children("option").remove();
                $("#select_dtr").children("option").remove();
                $("#select_cty").append("<option value='0'>"+"--请选择市、省直辖市--"+"</option>");
                $("#select_dtr").append("<option value='0'>"+"--请选择县、区--"+"</option>");
                var selectTmp=$("#select_pro").val();
                if(selectTmp!=0){
                    $.getJSON("${ctx}/areas/getAreasList/"+selectTmp, function(json){
                        //alert("JSON Data: " +json);
                        for(var i in json){
                            //alert(json[i].areaName);
                            $("#select_cty").append("<option value='"+json[i].areaCode+"'>"+json[i].areaName+"</option>");}
                    });
                }
            });

            //市发生改变时
            $("#select_cty").change(function () {
                //给隐藏的市名赋值
                $("#cityName").val($("#select_cty option:selected").text());
                $("#select_dtr").children("option").remove();
                $("#select_dtr").append("<option value='0'>"+"--请选择县、区--"+"</option>");
                var selectTmp=$("#select_cty").val();
                if(selectTmp!=0){
                    $.getJSON("${ctx}/areas/getAreasList/"+selectTmp, function(json){
                        //alert("JSON Data: " +json);
                        for(var i in json){
                            //alert(json[i].areaName);
                            $("#select_dtr").append("<option value='"+json[i].areaCode+"'>"+json[i].areaName+"</option>");}
                    });
                }
            });

            //区发生改变时
            $("#select_dtr").change(function () {
                //给隐藏的区名赋值
                $("#districtName").val($("#select_dtr option:selected").text());
            });

        });
    </script>

</head>
<body>
<div class="navigation">
    <div class="crumbs ">
        <i class="tm-iconfont icon-info"></i>
        <a href="#">卖家中心</a><span>&gt;</span><a href="#200">交易管理</a><span>&gt;</span>退货详情
    </div>
    <div class="help">
        <a href="#" target="_blank">卖家交易学习专区</a>
    </div>
</div>
<!--订单详情 star-->
<div class="order_details">
    <div class="p10 b-fffcf3 la-ffcc66">
        <div class="p-l20">
            <div class="fs14">当前订单状态：
                <c:if test="${orderRefundModel.oOrderRefund.orderStatus==0}">等待卖家审核</c:if>
                <c:if test="${orderRefundModel.oOrderRefund.orderStatus==1}">等待买家发货</c:if>
                <c:if test="${orderRefundModel.oOrderRefund.orderStatus==2}">卖家已发货</c:if>
                <c:if test="${orderRefundModel.oOrderRefund.orderStatus==3}">退货成功</c:if>
                <c:if test="${orderRefundModel.oOrderRefund.orderStatus==-1}">关闭的退货</c:if>
              </div>
            <div class="c-FF0000">联城提醒您</div>
            <div>买家提出售后要求，请积极与买家协商，做好售后服务。</div>
        </div>
    </div>
    <!--star 申请退款的商品-->
    <div class="mtc_box m-t20 line-all b-F5F5F5">
        <div class="mt line-bottom p-lr10 fs14">订单信息</div>
        <!--mc star-->
        <div class="mc b-FFFFFF p10">
            <!--star 02-->
            <div class="oh c m-tb10">
                <div class="u_table_list table001">
                    <!--star 名称-->
                    <div class="mtt line-left line-right line-top">
                        <table>
                            <colgroup>
                                <col width="45%">
                                <col width="15%">
                                <col width="10%">
                                <col width="10%">
                                <col width="10%">
                                <col width="10%">
                            </colgroup>
                            <tbody>
                            <tr class="fwb">
                                <th>商品</th>
                                <th>规格</th>
                                <th>单价（元）</th>
                                <th>数量</th>
                                <th>商品总价</th>
                                <th>运费（元）</th>
                            </tr>
                            </tbody>
                            <tbody>
                            <tr>
                                <td>
                                    <div class="product_name">
                                        <div class="t_img"><img src="${orderRefundModel.orderProductsEntityList[0].image}" /></div>
                                        <div class="t_info">
                                            <a href="#">${orderRefundModel.orderProductsEntityList[0].title}</a>
                                        </div>
                                    </div>
                                </td>
                                <td><span class="c-999999">${orderRefundModel.orderProductsEntityList[0].attribute}</span></td>
                                <td>${orderRefundModel.orderProductsEntityList[0].price}</td>
                                <td>${orderRefundModel.orderProductsEntityList[0].quantity}</td>
                                <td rowspan="${orderRefundModel.orderProductsEntityList.size()}" class="tac">
                                    <div class="fwb">${orderRefundModel.oOrderRefund.paymentMoneyAmount}</div>
                                </td>
                                <td rowspan="${orderRefundModel.orderProductsEntityList.size()}" class="tac">快递:${orderRefundModel.oOrderRefund.totalFreightAmount}</td>
                            </tr>

                            <c:forEach items="${orderRefundModel.orderProductsEntityList}" begin="1" var="list">
                            <tr>
                                <td>
                                    <div class="product_name">
                                        <div class="t_img"><img src="${list.image}" /></div>
                                        <div class="t_info">
                                            <a href="#">${list.title}</a>
                                        </div>
                                    </div>
                                </td>
                                <td><span class="c-999999">${list.attribute}</span></td>
                                <td>${list.price}</td>
                                <td>${list.quantity}</td>
                            </tr>
                            </c:forEach>
                            </tbody>
                        </table>
                    </div>
                    <!--end 商品-->
                </div>
            </div>
            <!--end 02-->
        </div>
        <!--mc end-->
    </div>
    <!--end 申请退款的商品-->
    <!--star 退款信息-->
    <div class="mtc_box m-t20 line-all b-F5F5F5">
        <div class="mt line-bottom p-lr10 fs14">退款信息</div>
        <!--mc star-->
        <div class="mc b-FFFFFF p10">
            <!--star 01-->
            <div class="p-lr20">
                <p>申请退款时间：<fmt:formatDate value="${orderRefundModel.oOrderRefund.orderTime}" pattern="yyyy-MM-dd HH:mm:ss"></fmt:formatDate></p>
                <p>退款状态：
                    <c:if test="${orderRefundModel.oOrderRefund.orderStatus==0}">等待卖家审核</c:if>
                    <c:if test="${orderRefundModel.oOrderRefund.orderStatus==1}">等待买家发货</c:if>
                    <c:if test="${orderRefundModel.oOrderRefund.orderStatus==2}">卖家已发货</c:if>
                    <c:if test="${orderRefundModel.oOrderRefund.orderStatus==3}">退货成功</c:if>
                    <c:if test="${orderRefundModel.oOrderRefund.orderStatus==-1}">关闭的退货</c:if>
                </p>
                <p>货物状态：
                    <c:if test="${orderRefundModel.oOrderRefund.goodsStatus==0}">等待买家发货</c:if>
                    <c:if test="${orderRefundModel.oOrderRefund.goodsStatus==1}">买家已发货</c:if>
                    <c:if test="${orderRefundModel.oOrderRefund.goodsStatus==2}">卖家已收货</c:if>
                </p>
                <p>退还给买家的金额：${orderRefundModel.oOrderRefund.paymentMoneyAmount}</p>
                <p>退款原因：${orderRefundModel.oOrderRefund.refundReason}</p>

                <c:if test="${orderRefundModel.oOrderRefund.orderStatus==0}">
                    <div class="u_tableform">
                        <form action="${ctx}/order/agreeRefundOrder" method="post">
                            <input type="hidden" name="orderRefundId" value="${orderRefundModel.oOrderRefund.orderRefundId}">
                            <div class="item">
                                <label class="l">收货地址：</label>
                                <div class="cont_txt">
                                    <input type="hidden" name="provinceName" id="provinceName"/>
                                    <select class="text w120 m-r10" id="select_pro" name="provinceCode">
                                        <optgroup value="0">省</optgroup>
                                    </select>
                                    <input type="hidden" name="cityName" id="cityName"/>
                                    <select class="text w120 m-r10" id="select_cty" name="cityCode">
                                        <optgroup value="市">市</optgroup>
                                    </select>
                                    <input type="hidden" name="districtName" id="districtName"/>
                                    <select class="text w120 m-r10" id="select_dtr" name="districtCode">
                                        <optgroup value="区">区</optgroup>
                                    </select>
                                </div>
                            </div>
                            <div class="item">
                                <label class="l">地址详情：</label>
                                <div class="cont_txt">
                                    <input type="text" class="text" value="" style="width:366px;" name="address"/>
                                </div>
                            </div>
                            <div class="item">
                                <label class="l" style="width:60px;">&nbsp;</label>
                                <div class="cont_txt">
                                    <button class="i_btn u2 p-lr50">同意退款</button>
                                </div>
                            </div>
                        </form>
                    </div>

                </c:if>
                <c:if test="${orderRefundModel.oOrderRefund.orderStatus>0}">
                    <p>卖家收货地址:${orderRefundModel.oOrderRefund.provinceName} ${orderRefundModel.oOrderRefund.cityName} ${orderRefundModel.oOrderRefund.districtName} ${orderRefundModel.oOrderRefund.address}<p>
                    <p>收货人:${orderRefundModel.oOrderRefund.consigneeName}</p>
                    <p>收货人联系电话：${orderRefundModel.oOrderRefund.consigneePhone}</p>
                    <p>卖家是否同意退款：是<p>
                </c:if>
            </div>
            <!--end 01-->
        </div>
        <!--mc end-->
    </div>
    <!--end 退款信息-->
    <!--star 订单信息-->
    <div class="mtc_box m-t20 line-all b-F5F5F5">
        <div class="mt line-bottom p-lr10 fs14">订单信息</div>
        <!--mc star-->
        <div class="mc b-FFFFFF p10">
            <!--star 01-->
            <div class="p-lr20">
                <p>订单编号：${order.orderNum}</p>
                <p>下单时间：<fmt:formatDate value="${order.orderTime}" pattern="yyyy-MM-dd HH:mm:ss"></fmt:formatDate></p>
                <p>付款时间：<fmt:formatDate value="${order.paymentTime}" pattern="yyyy-MM-dd HH:mm:ss"></fmt:formatDate></p>
                <p>确认时间：<fmt:formatDate value="${order.goodsGetTime}" pattern="yyyy-MM-dd HH:mm:ss"></fmt:formatDate></p>
                <p>买家账户：${changPhoneNum}</p>
                <p>商品总价：￥${order.totalProductAmount}</p>
                <p>运费 ：￥${order.totalFreightAmount}</p>
                <p>优惠：￥${order.totalDiscountAmount}</p>
                <p>订单总计：￥${order.totalOrderAmount}</p>
                <p>实付款：￥${order.paymentMoneyAmount}</p>
                <p>订单商品：</p>
            </div>
            <!--end 01-->
        </div>
        <!--mc end-->
    </div>
    <!--end 订单信息-->
    <!--star 留言/凭证记录-->
    <div class="mtc_box m-t20 line-all b-F5F5F5">
        <div class="mt line-bottom p-lr10 fs14">留言/凭证记录</div>
        <!--mc star-->
        <div class="mc b-FFFFFF p10">
            ....
        </div>
        <!--mc end-->
    </div>
    <!--end 留言/凭证记录-->
</div>
<!--订单详情 end -->

<div class="tac p-t40">
    <a href="${ctx}/order/getAllRefundOrdersByStatus?status=${orderRefundModel.oOrderRefund.orderStatus}"><button class="i_btn u2 p-lr50">返回订单列表</button></a>
    <div style="padding-bottom:100px; height:10px;"></div>
</div>
</body>
</html>
